*****************************
**Online Appendix Figure A4**
*****************************

use "Politician Survey Data.dta", clear

foreach y of varlist mca sex age religion education jubilee {
egen std_`y'=std(`y')
replace `y'=std_`y'
}
foreach y of varlist mca sex age religion education jubilee {
gen `y'_treat_violence=treat_violence
}
foreach y of varlist mca sex age religion education jubilee {
gen `y'_treat_anyrhetoric=treat2_anyrhetoric
}
lab var mca_treat_violence "County vs National Level"
lab var mca_treat_anyrhetoric "County vs National Level"
lab var sex_treat_violence "Sex"
lab var sex_treat_anyrhetoric "Sex"
lab var age_treat_violence "Age"
lab var age_treat_anyrhetoric "Age"
lab var religion_treat_violence "Religion"
lab var religion_treat_anyrhetoric "Religion"
lab var education_treat_violence "Education Level"
lab var education_treat_anyrhetoric "Education Level"
lab var jubilee_treat_violence "Party"
lab var jubilee_treat_anyrhetoric "Party"
foreach y of varlist mca sex age religion education jubilee {
quietly reg `y' `y'_treat_violence if `y'<=87
estimates store `y'_violence
}
foreach y of varlist mca sex age religion education jubilee {
quietly reg `y' `y'_treat_anyrhetoric if treat2_violence==0
estimates store `y'_anyrhetoric
}
coefplot mca_violence sex_violence age_violence religion_violence education_violence jubilee_violence mca_anyrhetoric sex_anyrhetoric age_anyrhetoric religion_anyrhetoric education_anyrhetoric jubilee_anyrhetoric, drop(_cons) xline(0) legend(off) pstyle(p1) xscale(range(-1/1)) xlabel(-1(0.2)1) headings(mca_treat_violence = "{bf:Violence}" mca_treat_anyrhetoric = "{bf:Any Rhetoric}")
eststo clear

*****************************
**Online Appendix Figure B4**
*****************************

use "Politician Survey Data.dta", clear

foreach y of varlist q10a q13a q15a q17a {
gen `y'_treat_violence=treat_violence
}
foreach y of varlist q10a q13a q15a q17a {
gen `y'_treat_rhetoric=treat2_rhetoric
}
foreach y of varlist q10a q13a q15a q17a {
gen `y'_treat_rhetoric_violence=treat2_rhetoric_violence
}
foreach y of varlist q10a q13a q15a q17a {
gen `y'_treat_anyrhetoric=treat2_anyrhetoric
}
lab var q10a_treat_violence "Likelihood of winning coethnic vote"
lab var q13a_treat_violence "Likelihood of winning election"
lab var q15a_treat_rhetoric "Likelihood of winning coethnic vote"
lab var q17a_treat_rhetoric "Likelihood of winning election"
lab var q15a_treat_rhetoric_violence "Likelihood of winning coethnic vote"
lab var q17a_treat_rhetoric_violence "Likelihood of winning election"
lab var q15a_treat_anyrhetoric "Likelihood of winning coethnic vote"
lab var q17a_treat_anyrhetoric "Likelihood of winning election"
foreach y of varlist q10a q13a {
quietly reg `y' `y'_treat_violence if `y'<=87
estimates store `y'_violence
}
foreach y of varlist q15a q17a {
quietly reg `y' `y'_treat_rhetoric if treat2_violence==0 & treat2_rhetoric_violence==0
estimates store `y'_rhetoric
}
foreach y of varlist q15a q17a {
quietly reg `y' `y'_treat_rhetoric_violence if treat2_violence==0 & treat2_rhetoric==0
estimates store `y'_rhetoric_violence
}
foreach y of varlist q15a q17a {
quietly reg `y' `y'_treat_anyrhetoric if treat2_violence==0
estimates store `y'_anyrhetoric
}
coefplot q10a_violence q13a_violence q15a_rhetoric q17a_rhetoric q15a_rhetoric_violence q17a_rhetoric_violence q15a_anyrhetoric q17a_anyrhetoric, drop(_cons) xline(0) legend(off) pstyle(p1) xscale(range(-5/5)) xlabel(-5/5) headings(q10a_treat_violence = "{bf:Violence}" q15a_treat_rhetoric = "{bf:Rhetoric}" q15a_treat_rhetoric_violence = "{bf:Rhetoric + Violence}" q15a_treat_anyrhetoric = "{bf:Any Rhetoric}")

*****************************
**Online Appendix Figure B5**
*****************************

use "Politician Survey Data.dta", clear

set seed 2022

*Effect of violence on coethnic voting*
permute treat_violence (r(mu_2)-r(mu_1)), reps (1000) nodrop nowarn: ttest q10a, by (treat_violence)
*Effect of violence on winning election*
permute treat_violence (r(mu_2)-r(mu_1)), reps (1000) nodrop nowarn: ttest q13a, by (treat_violence)

*Effect of rhetoric on coethnic voting*
permute treat2_rhetoric (r(mu_2)-r(mu_1)) if treat2_violence==0 & treat2_rhetoric_violence==0, reps (1000) nodrop nowarn: ttest q15a, by (treat2_rhetoric)
*Effect of rhetoric on winning election*
permute treat2_rhetoric (r(mu_2)-r(mu_1)) if treat2_violence==0 & treat2_rhetoric_violence==0, reps (1000) nodrop nowarn: ttest q17a, by (treat2_rhetoric)

*Effect of rhetoric+violence on coethnic voting*
permute treat2_rhetoric_violence (r(mu_2)-r(mu_1)) if treat2_violence==0 & treat2_rhetoric==0, reps (1000) nodrop nowarn: ttest q15a, by (treat2_rhetoric_violence)
*Effect of rhetoric+violence on winning election*
permute treat2_rhetoric_violence (r(mu_2)-r(mu_1)) if treat2_violence==0 & treat2_rhetoric==0, reps (1000) nodrop nowarn: ttest q17a, by (treat2_rhetoric_violence)

*Effect of any rhetoric on coethnic voting*
permute treat2_anyrhetoric (r(mu_2)-r(mu_1)) if treat2_violence==0, reps (1000) nodrop nowarn: ttest q15a, by (treat2_anyrhetoric)
*Effect of any rhetoric on winning election*
permute treat2_anyrhetoric (r(mu_2)-r(mu_1)) if treat2_violence==0, reps (1000) nodrop nowarn: ttest q17a, by (treat2_anyrhetoric)
